/*
 * PS3 Media Server, for streaming any medias to your PS3.
 * Copyright (C) 2008  A.Brochard
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License only.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package net.pms.io;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * Wrapper for executing a command line process while keeping an eye on it from PMS. 
 */
public interface ProcessWrapper extends UnusedProcess {
	/**
	 * Retrieves the input stream generated by the command line process.
	 *
	 * @param seek Number of bytes to skip in the input stream.
	 * @return The input stream coming from the process.
	 * @throws IOException
	 */
	public InputStream getInputStream(long seek) throws IOException;

	public List<String> getResults();

	/**
	 * Returns whether or not there still is an underlying process to destroy.
	 * Will return <code>true</code> if the underlying process has been
	 * destroyed already.
	 *
	 * @return <code>true</code> if the process has already been destroyed,
	 * <code>false</code> otherwise.
	 */
	public boolean isDestroyed();

	/**
	 * Starts the underlying command line process in a new thread. This means
	 * that the process will run in parallel with the current thread and that
	 * the current thread will not be blocked by its execution.
	 */
	public void runInNewThread();

	/**
	 * Starts the underlying command line process in the same thread as the
	 * current thread. This means that the current thread will block until
	 * the execution of the process is finished.
	 */
	public void runInSameThread();
	
}
